package com.whw.fy.service.impl;

import com.whw.fy.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.whw.fy.entity.AreaType;
import com.whw.fy.mapper.AreaTypeMapper;
import com.whw.fy.service.AreaTypeService;
@Service
public class AreaTypeServiceImpl implements AreaTypeService{

    @Resource
    private AreaTypeMapper areaTypeMapper;

    @Override
    public Message deleteByPrimaryKey(Integer areaTypeId) {
        return areaTypeMapper.deleteByPrimaryKey(areaTypeId) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insert(AreaType record) {
        return areaTypeMapper.insert(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insertSelective(AreaType record) {
        return areaTypeMapper.insertSelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer areaTypeId) {
        return Message.success(null).add(areaTypeMapper.selectByPrimaryKey(areaTypeId));
    }

    @Override
    public Message updateByPrimaryKeySelective(AreaType record) {
        return areaTypeMapper.updateByPrimaryKeySelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(AreaType record) {
        return areaTypeMapper.updateByPrimaryKey(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message selectAll() {
        return Message.success(null).add(areaTypeMapper.selectAll());
    }

}
